package cn.kkcxy.blog.system.factory.login;

import cn.kkcxy.blog.core.dto.client.LoginParamsDTO;
import cn.kkcxy.blog.core.enums.LoginTypeEnum;
import cn.kkcxy.blog.core.result.ResponseEntity;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.util.Map;


/**
 * @BelongsProject: kkcxy-blog
 * @BelongsPackage: cn.kkcxy.blog.system.factory.login
 * @Author: kkcxy
 * @CreateTime: 2024-09-11 22:44
 * @Description: 登录类型处理接口
 * @Version: 1.0
 */
public interface LoginTypeHandler {

    /**
     * 枚举身份的识别
     */
    LoginTypeEnum getHandlerType();

    /**
     * 枚举登录处理
     */
    Map<String, String> login(String code, LoginParamsDTO loginParamsDTO, String ip);

    /**
     * 登录日志记录
     */
    void loginLogCreate(Long userId, Integer loginType, String message, Integer status, String ip);

    /**
     * 登录验证码获取
     */
    ResponseEntity<Object> getCode(HttpServletResponse response, String account) throws IOException;
}
